﻿./shutdown.sh
rm -rf logs

CWD=`pwd`
LIBS_DIR="${CWD}/libs"
JARS_DIR="${CWD}/jars"
PID_FILE="logs/mimicam.pid"
STD_OUT="logs/stdout.log"

for jar in `ls ${LIBS_DIR}`
do
    LIBS="${LIBS}:${LIBS_DIR}/${jar}"
done
for lib in `ls ${JARS_DIR}`
do
    LIBS="${LIBS}:${JARS_DIR}/${lib}"
done

PARAMS="-Dfile.encoding=utf-8"
EXEC_BIN="com.weilive.api.Main"
COMMOND="/usr/java/jre1.7.0_21/bin/java ${PARAMS} -cp ./conf:${LIBS} ${EXEC_BIN}"

mkdir logs &> /dev/null
$COMMOND >> ${STD_OUT} 2>&1 &
#nohup sh -c "exec $COMMOND >> ${STD_OUT} 2>&1" >/dev/null & 
echo $! > $PID_FILE
